﻿using ShiQuan.IotDevice.Business;
using ShiQuan.Utility;
using ShiQuan.WebBase;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;

namespace ShiQuan.IotDevice.Web.Api
{
    /// <summary>
    /// 设备安装信息
    /// </summary>
    public class DeviceInstallController : BaseApiController
    {
        // GET: DeviceInstall
        /// <summary>
        /// 读取设备最新数据 
        /// </summary>
        /// <param name="queryJson">主键值</param>
        /// <returns>返回对象Json</returns>
        [HttpPost]
        public AjaxResult GetList([FromBody]string queryJson)
        {
            try
            {
                DeviceInstallBLL service = new DeviceInstallBLL();
                /*设备最新数据*/
                var data = service.GetList(queryJson).Select(my=>my.SerialNumber);
                return Success("读取成功", data.ToJson());
            }
            catch (Exception ex)
            {
                return this.Error(ex.Message);
            }
        }
    }
}